
' the top of the form, you can have it on the bottom, the left, or right!

     $INCLUDE "RAPIDQ2.INC"
     $TYPECHECK ON
     $APPTYPE GUI

     $RESOURCE BMP_CLOSE AS "x.BMP"
     $RESOURCE BMP_MIN   AS "x.BMP"
     $RESOURCE BMP_MAX   AS "x.BMP"
     $RESOURCE BMP_HELP  AS "x.BMP"
     '$RESOURCE BMP_IMAGE AS "frame.BMP"
     


CONST WM_SYSCOMMAND = &H0112
CONST SC_SIZE = 61440
CONST SC_MOVE = 61456
CONST SC_MINIMIZE = 61472
CONST SC_MAXIMIZE = 61488
CONST SC_CLOSE = 61536
CONST SC_RESTORE = 61728

CONST WM_SIZING = 532
CONST WM_MOVING = 534

DECLARE FUNCTION PaintDesktop LIB "USER32" ALIAS "PaintDesktop" (HDC AS INTEGER) AS INTEGER

DECLARE SUB FormWndProc (Hwnd&, uMsg&, wParam&, lParam&)
DECLARE SUB PaintForm

' Test QrForm component
'--------------------------------
     
     declare sub prmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub prmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub prmouseup
     declare sub plmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub plmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub plmouseup
     declare sub pumousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub pumousemove (X AS INTEGER, Y AS INTEGER)
     declare sub pumouseup
     declare sub pdmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub pdmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub pdmouseup
     declare sub pulmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub pulmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub pulmouseup
     declare sub puulmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub puulmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub puulmouseup
     declare sub purmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub purmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub purmouseup
     declare sub puurmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub puurmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub puurmouseup
     declare sub pdlmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub pdlmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub pdlmouseup
     declare sub pddlmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub pddlmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub pddlmouseup
     declare sub pdrmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub pdrmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub pdrmouseup
     declare sub pddrmousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub pddrmousemove (X AS INTEGER, Y AS INTEGER)
     declare sub pddrmouseup
     declare sub titlemousedown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
     declare sub titlemousemove (X AS INTEGER, Y AS INTEGER)
     declare sub titlemouseup
     declare sub minbuttonclick
     declare sub maxbuttonclick
     declare sub helpbuttonclick
     declare sub fileclick
     declare sub newclick
     declare sub openclick
     declare sub exitclick
     declare sub resizemainform
     declare sub processExplorer
     
     
     DIM MainForm AS QFORM
     DIM PanelR AS QPANEL, PanelL AS QPANEL, PanelD AS QPANEL, PanelU AS QPANEL
     DIM PanelDL AS QPANEL, PanelDDL AS QPANEL
     DIM PanelDR AS QPANEL, PanelDDR AS QPANEL
     DIM PanelUL AS QPANEL, PanelUUL AS QPANEL
     DIM PanelUR AS QPANEL, PanelUUR AS QPANEL
     DIM MainPanel AS QPANEL
     DIM TitlePanel AS QPANEL
     DIM Image AS QIMAGE
     DIM Font AS QFONT
     Font.Name = "trebuchet ms"
     Font.Size = 9
     Font.COLOR = &HFFFFFF
     DIM CloseButton AS QBUTTON, MinButton AS QBUTTON
     DIM MaxButton AS QBUTTON, HelpButton AS QBUTTON
     DIM DownX AS INTEGER, DownY AS INTEGER
     DIM PLMouse AS INTEGER, PRMouse AS INTEGER
     DIM PUMouse AS INTEGER, PDMouse AS INTEGER
     DIM PULMouse AS INTEGER, PUULMouse AS INTEGER
     DIM PURMouse AS INTEGER, PUURMouse AS INTEGER
     DIM PDLMouse AS INTEGER, PDDLMouse AS INTEGER
     DIM PDRMouse AS INTEGER, PDDRMouse AS INTEGER
     DIM TitleMouse AS INTEGER, FormX AS INTEGER, FormY AS INTEGER
     DIM FilePopup AS QPOPUPMENU

     DIM NewItem AS QMENUITEM, OpenItem AS QMENUITEM
     DIM Break1 AS QMENUITEM, ExitItem AS QMENUITEM

     
     'explorer declarations
     DIM Explorer AS QOLECONTAINER
     dim html$ as string
     
     MainForm.BorderStyle = bsNone
     MainForm.OnShow = processExplorer
     MainForm.Center
     MainForm.OnResize = ResizeMainForm

     PanelR.PARENT = MainForm
     PanelR.Top = 20
     PanelR.Width = 2
     PanelR.OnMouseDown = PRMouseDown
     PanelR.OnMouseMove = PRMouseMove
     PanelR.OnMouseUp = PRMouseUp
     PanelR.Cursor = crSizeWE
     panelR.bevelOuter = 0
     PanelL.PARENT = MainForm
     PanelL.Left = 0
     PanelL.Top = 20
     PanelL.Width = 2
     PanelL.OnMouseDown = PLMouseDown
     PanelL.OnMouseMove = PLMouseMove
     PanelL.OnMouseUp = PLMouseUp
     PanelL.Cursor = crSizeWE
     PanelL.bevelOuter = 0
     PanelU.PARENT = MainForm
     PanelU.Left = 20
     PanelU.Top = 0
     PanelU.Height = 2
     PanelU.OnMouseDown = PUMouseDown
     PanelU.OnMouseMove = PUMouseMove
     PanelU.OnMouseUp = PUMouseUp
     PanelU.Cursor = crSizeNS
     Panelu.bevelOuter = 0
     PanelD.PARENT = MainForm
     PanelD.Left = 20
     PanelD.Height = 2
     PanelD.OnMouseDown = PDMouseDown
     PanelD.OnMouseMove = PDMouseMove
     PanelD.OnMouseUp = PDMouseUp
     PanelD.Cursor = crSizeNS
     PanelD.bevelOuter = 0

     PanelUL.PARENT = MainForm
     PanelUL.Left = 0
     PanelUL.Top = 0
     PanelUL.Width = 2
     PanelUL.Height = 20
     PanelUL.OnMouseDown = PULMouseDown
     PanelUL.OnMouseMove = PULMouseMove
     PanelUL.OnMouseUp = PULMouseUp
     PanelUL.Cursor = crSizeNWSE
     PanelUL.bevelOuter = 0
     PanelUUL.PARENT = MainForm
     PanelUUL.Left = 0
     PanelUUL.Top = 0
     PanelUUL.Width = 20
     PanelUUL.Height = 2
     PanelUUL.OnMouseDown = PUULMouseDown
     PanelUUL.OnMouseMove = PUULMouseMove
     PanelUUL.OnMouseUp = PUULMouseUp
     PanelUUL.Cursor = crSizeNWSE
     PanelUUL.bevelOuter = 0

     PanelUR.PARENT = MainForm
     PanelUR.Top = 0
     PanelUR.Width = 2
     PanelUR.Height = 20
     PanelUR.OnMouseDown = PURMouseDown
     PanelUR.OnMouseMove = PURMouseMove
     PanelUR.OnMouseUp = PURMouseUp
     PanelUR.Cursor = crSizeNESW
     PanelUR.bevelOuter = 0
     PanelUUR.PARENT = MainForm
     PanelUUR.Top = 0
     PanelUUR.Width = 20
     PanelUUR.Height = 2
     PanelUUR.OnMouseDown = PUURMouseDown
     PanelUUR.OnMouseMove = PUURMouseMove
     PanelUUR.OnMouseUp = PUURMouseUp
     PanelUUR.Cursor = crSizeNESW
     PanelUUR.bevelOuter = 0

     PanelDL.PARENT = MainForm
     PanelDL.Left = 0
     PanelDL.Width = 2
     PanelDL.Height = 20
     PanelDL.OnMouseDown = PDLMouseDown
     PanelDL.OnMouseMove = PDLMouseMove
     PanelDL.OnMouseUp = PDLMouseUp
     PanelDL.Cursor = crSizeNESW
     PanelDL.bevelOuter = 0
     PanelDDL.PARENT = MainForm
     PanelDDL.Left = 0
     PanelDDL.Width = 20
     PanelDDL.Height = 2
     PanelDDL.OnMouseDown = PDDLMouseDown
     PanelDDL.OnMouseMove = PDDLMouseMove
     PanelDDL.OnMouseUp = PDDLMouseUp
     PanelDDL.Cursor = crSizeNESW
     PanelDDL.bevelOuter = 0

     PanelDR.PARENT = MainForm
     PanelDR.Width = 2
     PanelDR.Height = 20
     PanelDR.OnMouseDown = PDRMouseDown
     PanelDR.OnMouseMove = PDRMouseMove
     PanelDR.OnMouseUp = PDRMouseUp
     PanelDR.Cursor = crSizeNWSE
     PanelDR.bevelOuter = 0
     PanelDDR.PARENT = MainForm
     PanelDDR.Width = 20
     PanelDDR.Height = 2
     PanelDDR.OnMouseDown = PDDRMouseDown
     PanelDDR.OnMouseMove = PDDRMouseMove
     PanelDDR.OnMouseUp = PDDRMouseUp
     PanelDDR.Cursor = crSizeNWSE
     PanelDDR.bevelOuter = 0

     TitlePanel.PARENT = MainForm
     TitlePanel.Alignment = taLeftJustify
     TitlePanel.Left = 54
     TitlePanel.Top = 2
     TitlePanel.Height = 17
     TitlePanel.COLOR = &HDD7777
     TitlePanel.Font = Font
     TitlePanel.CAPTION = " CUSTOM FORM"
     TitlePanel.OnMouseDown = TitleMouseDown
     TitlePanel.OnMouseMove = TitleMouseMove
     TitlePanel.OnMouseUp = TitleMouseUp
     TitlePanel.bevelOuter = 0
     
     CloseButton.PARENT = MainForm
     CloseButton.Top = 2
     CloseButton.Width = 17
     CloseButton.Height = 17
     CloseButton.Left = 2
     CloseButton.BMPHandle = BMP_Close
     CloseButton.ModalResult = mrCANCEL

     MinButton.PARENT = MainForm
     MinButton.Top = 2
     MinButton.Width = 17
     MinButton.Height = 17
     MinButton.Left = 20
     MinButton.BMPHandle = BMP_Min
     MinButton.OnClick = MinButtonClick


     MaxButton.PARENT = MainForm
     MaxButton.Top = 2
     MaxButton.Width = 17
     MaxButton.Height = 17
     MaxButton.Left = 37
'     MaxButton.GroupIndex = 1
'     MaxButton.Down = False
'     MaxButton.AllowAllUp = True
     MaxButton.BMPHandle = BMP_Max
     MaxButton.OnClick = MaxButtonClick


     HelpButton.PARENT = MainForm
     HelpButton.Top = 2
     HelpButton.Width = 17
     HelpButton.Height = 17
     HelpButton.BMPHandle = BMP_Help
     HelpButton.OnClick = HelpButtonClick


     MainPanel.PARENT = MainForm
     MainPanel.Left = 2
     MainPanel.Top = 21

     explorer.left=2
     explorer.top=21
     explorer.BorderStyle=BsNone
     explorer.PARENT = MainForm


     ResizeMainForm
     MainForm.CAPTION = "Custom form"
     
     $Include "Minimize.inc"

     SetMinimize(MainForm)

     MainForm.WndProc = FormWndProc
     MainForm.OnPaint = PaintForm

     MainForm.ShowModal
     explorer.free




     SUB ResizeMainForm
      IF MainForm.ClientWidth < 22 THEN
       MainForm.ClientWidth = 22
      END IF
      IF MainForm.ClientHeight < 22 THEN
       MainForm.ClientHeight = 22
      END IF

      PanelR.Left = MainForm.ClientWidth-2
      PanelR.Height = MainForm.ClientHeight - 40
      PanelL.Height = MainForm.ClientHeight - 40
      PanelU.Width = MainForm.ClientWidth - 40
      PanelD.Top = MainForm.ClientHeight-2
      PanelD.Width = MainForm.ClientWidth - 40

      PanelDL.Top = MainForm.ClientHeight-20
      PanelDDL.Top = MainForm.ClientHeight-2

      PanelDR.Left = MainForm.ClientWidth-2
      PanelDR.Top = MainForm.ClientHeight-20
      PanelDDR.Left = MainForm.ClientWidth-20
      PanelDDR.Top = MainForm.ClientHeight-3

      PanelUR.Left = MainForm.ClientWidth-2
      PanelUUR.Left = MainForm.ClientWidth-20

      HelpButton.Left = MainForm.ClientWidth - 20

      TitlePanel.Width = MainForm.ClientWidth - 75

      MainPanel.Width = MainForm.ClientWidth - 4
      MainPanel.Height = 0'MainForm.ClientHeight - 23

     Explorer.Width = mainform.ClientWidth-4
     Explorer.Height = mainform.ClientHeight-23

     END SUB

     SUB PLMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PLMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PLMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PLMouse THEN
       IF MainForm.ClientWidth > 22 THEN
        MainForm.Left = MainForm.Left+(X - DownX)
       END IF
       MainForm.Width = MainForm.Width+(DownX - X)
       ResizeMainForm
      END IF
     END SUB
     SUB PLMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PLMouse = FALSE
     END SUB

     SUB PRMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PRMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PRMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PRMouse THEN
       MainForm.Width = MainForm.Width+(X - DownX)
       ResizeMainForm
      END IF
     END SUB
     SUB PRMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PRMouse = FALSE
     END SUB

     SUB PUMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PUMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PUMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PUMouse THEN
       IF MainForm.ClientHeight > 22 THEN
        MainForm.Top = MainForm.Top+(Y - DownY)
       END IF
       MainForm.Height = MainForm.Height+(DownY - Y)
       ResizeMainForm
      END IF
     END SUB
     SUB PUMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PUMouse = FALSE
     END SUB

     SUB PDMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PDMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PDMouse THEN
       MainForm.Height = MainForm.Height+(Y - DownY)
       ResizeMainForm
      END IF
     END SUB
     SUB PDMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDMouse = FALSE
     END SUB

     SUB PULMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PULMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PULMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PULMouse THEN
       MainForm.Top = MainForm.Top+(Y - DownY)
       MainForm.Height = MainForm.Height+(DownY - Y)
       MainForm.Left = MainForm.Left+(X - DownX)
       MainForm.Width = MainForm.Width+(DownX - X)
       ResizeMainForm
      END IF
     END SUB
     SUB PULMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PULMouse = FALSE
     END SUB
     SUB PUULMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PUULMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PUULMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PUULMouse THEN
       MainForm.Top = MainForm.Top+(Y - DownY)
       MainForm.Height = MainForm.Height+(DownY - Y)
       MainForm.Left = MainForm.Left+(X - DownX)
       MainForm.Width = MainForm.Width+(DownX - X)
       ResizeMainForm
      END IF
     END SUB
     SUB PUULMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PUULMouse = FALSE
     END SUB

     SUB PURMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PURMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PURMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PURMouse THEN
       MainForm.Top = MainForm.Top+(Y - DownY)
       MainForm.Height = MainForm.Height+(DownY - Y)
       MainForm.Width = MainForm.Width+(X - DownX)
       ResizeMainForm
      END IF
     END SUB
     SUB PURMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PURMouse = FALSE
     END SUB
     SUB PUURMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PUURMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PUURMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PUURMouse THEN
       MainForm.Top = MainForm.Top+(Y - DownY)
       MainForm.Height = MainForm.Height+(DownY - Y)
       MainForm.Width = MainForm.Width+(X - DownX)
       ResizeMainForm
      END IF
     END SUB
     SUB PUURMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PUURMouse = FALSE
     END SUB

     SUB PDLMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDLMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PDLMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PDLMouse THEN
       MainForm.Left = MainForm.Left+(X - DownX)
       MainForm.Width = MainForm.Width+(DownX - X)
       MainForm.Height = MainForm.Height+(Y - DownY)
       ResizeMainForm
      END IF
     END SUB
     SUB PDLMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDLMouse = FALSE
     END SUB
     SUB PDDLMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDDLMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PDDLMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PDDLMouse THEN
       MainForm.Left = MainForm.Left+(X - DownX)
       MainForm.Width = MainForm.Width+(DownX - X)
       MainForm.Height = MainForm.Height+(Y - DownY)
       ResizeMainForm
      END IF
     END SUB
     SUB PDDLMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDDLMouse = FALSE
     END SUB

     SUB PDRMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDRMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PDRMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PDRMouse THEN
       MainForm.Height = MainForm.Height+(Y - DownY)
       MainForm.Width = MainForm.Width+(X - DownX)
       ResizeMainForm
      END IF
     END SUB
     SUB PDRMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDRMouse = FALSE
     END SUB
     SUB PDDRMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDDRMouse = TRUE
      DownX = X
      DownY = Y
     END SUB
     SUB PDDRMouseMove (X AS INTEGER, Y AS INTEGER)
      IF PDDRMouse THEN
       MainForm.Height = MainForm.Height+(Y - DownY)
       MainForm.Width = MainForm.Width+(X - DownX)
       ResizeMainForm
      END IF
     END SUB
     SUB PDDRMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      PDDRMouse = FALSE
     END SUB

     SUB TitleMouseDown (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      TitleMouse = TRUE
      DownX = X
      DownY = Y
      FormX = MainForm.Left
      FormY = MainForm.Top
     END SUB
     SUB TitleMouseMove (X AS INTEGER, Y AS INTEGER)
      IF TitleMouse = TRUE AND MainForm.WindowState = wsNormal THEN
       MainForm.Left = FormX + (X - DownX)
       MainForm.Top = FormY + (Y - DownY)
       FormX = MainForm.Left
       FormY = MainForm.Top
      END IF
     END SUB
     SUB TitleMouseUp (BTN AS INTEGER, X AS INTEGER, Y AS INTEGER)
      TitleMouse = FALSE
     END SUB

     SUB MinButtonClick
      MainForm.WindowState = wsMinimized
     END SUB

     SUB MaxButtonClick
      IF MainForm.WindowState = wsMaximized THEN
       MainForm.WindowState = wsNormal
       ResizeMainForm
      ELSE
       MainForm.WindowState = wsMaximized
       ResizeMainForm
      END IF
     END SUB

     SUB HelpButtonClick
      SHOWMESSAGE "Beware the power of Rapid-Q"
     END SUB

     SUB FileClick
      FilePopup.Popup(MainForm.Left + 30, MainForm.Top + 50)
     END SUB


     SUB ExitClick
      MainForm.CLOSE
      Application.terminate
     END SUB
     
     SUB processExplorer
	dim $controlloHtml as string
	Explorer.CreateObject("Shell.Explorer.1")
    $controlloHtml = UCASE$(LEFT$(Command$(1), 7))
	if $controlloHtml = "HTTP://" then
         html$= Command$(1)
	else
	     html$="http://127.0.0.1:1971/"+Command$(1)	
	end if

     Explorer.Navigate(html$)
     end sub

SUB FormWndProc (Hwnd&, uMsg&, wParam&, lParam&)
  IF uMsg& = WM_MOVING OR uMsg& = WM_SIZING THEN
    PaintForm
  END IF
  IF uMsg& = 6 THEN MainForm.Show
  IF uMsg& = WM_SYSCOMMAND THEN
    'Application.Minimize
    'Form.Visible = 0
    'IF wParam& = SC_MINIMIZE THEN Application.Minimize
  END IF
END SUB

SUB PaintForm
'	PaintDesktop GetDC(MainForm.Handle)
'	PaintDesktop GetDC(PanelR.Handle)
'	PaintDesktop GetDC(PanelL.Handle)
'	PaintDesktop GetDC(PanelU.Handle)
'	PaintDesktop GetDC(PanelD.Handle)


'      PanelDL.Top = MainForm.ClientHeight-20
'      PanelDDL.Top = MainForm.ClientHeight-2

'      PanelDR.Left = MainForm.ClientWidth-2
'      PanelDR.Top = MainForm.ClientHeight-20
'      PanelDDR.Left = MainForm.ClientWidth-20
'      PanelDDR.Top = MainForm.ClientHeight-3

'      PanelUR.Left = MainForm.ClientWidth-2
'      PanelUUR.Left = MainForm.ClientWidth-20

'      HelpButton.Left = MainForm.ClientWidth - 20

'PaintDesktop GetDC(TitlePanel.Handle)

'      MainPanel.Width = MainForm.ClientWidth - 4
'      MainPanel.Height = 0'MainForm.ClientHeight - 23
END SUB
     
     

